/**
 * User: yeqingzhou01
 * Date: 13-8-28
 * Time: 下午6:08
 */
//data source util
exports.dbUtil = require('../repository/db_utils/db-mongodb-utils');
//local mongo db
exports.mongo = {};
exports.mongo.systemConfig = {
    connectionPoolSize: 100000
}
exports.mongo.dbInfo = {
    dbName: 'anicel',
    userName: 'work',
    password: 'work',
    rootPassword: 'anicloudinc%2010',
    mongosList: [
        {
            host: 'dev.anicloud.org',
            port: 11811
        }
    ]
};
var generateMongooseMongosAddress = function () {
    var dbInfo = exports.mongo.dbInfo;
    var oneMongosAddr = function (oneHost) {
        return 'mongodb://' +
            dbInfo.userName +
            ':' +
            dbInfo.password +
            '@' +
            oneHost.host +
            ':' +
            oneHost.port +
            '/' +
            dbInfo.dbName
    }
    return (function () {
        var finalUri = '';
        var isFirst = true;
        for (var oneMongosIdx in dbInfo.mongosList) {
            if (!isFirst) {
                finalUri += ','
            }
            isFirst = false;
            finalUri +=
                oneMongosAddr(dbInfo.mongosList[oneMongosIdx]);
        }
        return finalUri;
    }());
}
exports.mongo.db = generateMongooseMongosAddress();